<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" href="css/base.css" type="text/css" />
<script type="text/javascript">
	window.onload = function(){
		//它是客户端代码   jsp
		var upage = document.getElementById("upage");
		
		var totalPage = '<s:property value="totalPage"/>';
		//当前页码
		var page = '<s:property value="page"/>';
		
		var html = "<li>"
        				+"<a href='pl_showPList.action?page=1&pageSize=6'><span class='arrow_left'></span></a>";
        			+"</li>";
        			
       for(var i =0;i<totalPage;i++){
    	   if(i == page -1){
    		   html += "<li class='page_active'><a  href='pl_showPList.action?page="+(i+1)+"&pageSize=6'>"+(i+1)+"</a></li>";
    	   }else{
    		   html += "<li><a href='pl_showPList.action?page="+(i+1)+"&pageSize=6'>"+(i+1)+"</a></li>";
    	   }
    	  
       } 			
        html +=" <li><a href='pl_showPList.action?page="+(totalPage)+"&pageSize=6'><span class='arrow_right'></span></a></li>";
		upage.innerHTML = html;
	}
</script>

</head>

<body>
    <div class="main_right_top">您现在所在位置 > <span>品类管理</span></div>
    <div class="main_right_body">
    <div class="body_content"> 
        <div class="biao_list">
            <div class="set_all">
                <h1 class="biao_title">品类管理</h1>
                <a href="add_pl.jsp" class="set_btn_link">添加品类</a>
            </div><!--set_all-->
           
            <table border="0" cellspacing="0" cellpadding="0">
                <thead>
                    <tr>
                        <th>品类ID</th>
						<th>品类名称</th>
						<th>操作</th>
                    </tr>
                </thead>
                <tbody>
           		 	<s:iterator value="listPVO" var="pvo" status="sta">
                    	<tr>
							
							<td><s:property value="#pvo.id"/></td>
							<td><s:property value="#pvo.pname"/></td>
							<td>
								<a href="pl_showPlInfo.action?pid=<s:property value='#pvo.id'/>&page=1&pageSize=5"  class="td_detail">查看</a>
								<!--与老师写的不一样，老师是转到action层 -->
								<a href="alter_pl.jsp?pname=<s:property value="#pvo.pname"/>&pid=<s:property value="#pvo.id"/>" class="td_edit">修改</a>
                                <a href="pl_deletePl.action?pid=<s:property value='#pvo.id'/>" class="td_detele" id="delete">删除</a>
                            </td>
						</tr>
						</s:iterator> 
                </tbody>
            </table>
      
            <div class="page_all">
                <div class="page">
                    <ul id="upage">
                     
                        
                    </ul>
                </div>
                <div class="clr"></div>
            </div><!--page_all-->
            
        </div><!--biao_list-->
        </div>
    </div> <!--main_right_body-->
</body>
</html>
